import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import fire from '@dfeidao/atom-web/msg/fire';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';

export default async function a004(fd: IFeidaoAiBrowserComponent) {
	// 点击确定
	const ns_chk = fd.data.node.querySelectorAll('[data-id="list"]:checked');
	const list = Array.from(ns_chk) as HTMLInputElement[];//伪数组转数组
	if (list.length === 0) {
		alert('请选择至少一列数据');
	} else {
		const source = list.map(n => {
			return n.getAttribute('data-no');
		});
		console.log('qq', source);
		const n = fd.data.node.querySelector<HTMLDivElement>('[data-id="yinhuanyuan"]');
		set_node_cls(n, 'display-n', true);
		fire('zj-000006', 'a005', source);

	}


	// 	//回填
	// 	const flag = get(fd, 'flag') as string;
	// 	if (flag === 'add') {
	// 		fire('zj-000004', 'a009');//(,d)
	// 	} else {
	// 	}
}
